package com.deshan.websys.api.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.deshan.websys.api.utils.CommonResult;
import com.deshan.websys.code.model.PmsComment;
import com.deshan.websys.code.service.PmsCommentService;

import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;

@Api(tags = "留言后台管理")
@RestController
@RequestMapping("/manage/comment")
@AllArgsConstructor
public class CommentController {

	private final PmsCommentService commentService;

	@PostMapping("/save")
	public CommonResult saveComment(@RequestBody PmsComment pmsComment) {
		pmsComment.setAuditing("0");
		return commentService.saveOrUpdate(pmsComment) ? CommonResult.success() : CommonResult.failed("保存失败");
	}
}
